
<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>关于我们-修改</title>
    <meta name="keywords" content="">
    <meta name="description" content="">

    <include file="common_css"/>
    <script type="text/javascript" charset="utf-8" src="__PUBLIC__/common/js/ueditor/ueditor.config.js"></script>
    <script type="text/javascript" charset="utf-8" src="__PUBLIC__/common/js/ueditor/ueditor.all.min.js"> </script>
    <script type="text/javascript" charset="utf-8" src="__PUBLIC__/common/js/ueditor/lang/zh-cn/zh-cn.js"></script>
</head>

<body class="gray-bg">
    <div class="wrapper wrapper-content">
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>关于我们</h5>
                        <a class="btn btn-sm btn-success" style="float: right;margin-bottom: 3px;" href="javascript:location.replace(location.href);" title="刷新"><i class="fa fa-refresh"></i> </a>
                        <button id="edit" class="btn btn-primary btn-xs m-l-sm" onclick="edit()" type="button">编辑</button>
                        <button id="save" class="btn btn-primary  btn-xs" onclick="save(this,'{$msg.id}')" type="button">保存</button>
                    </div>
                    <div class="ibox-content" id="eg">
                        <div class="click2edit wrapper ueditor">
                            <textarea id="content" name="content" style="">{$msg.content}</textarea>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!-- 全局js -->
    <include file="common_js"/>
    <!-- 自定义js -->
    <script src="__PUBLIC__/admin/js/content.js?v=1.0.0"></script>

    <script>
        var editor;
        $(document).ready(function () {
            editor=UE.getEditor('content');
        });

        function edit() {
            $('.ueditor').show();
        }

        function save(obj,id) {
            $('.ueditor').hide();
            var content = editor.getContent();
            if(!content){
                layer.msg("内容不能为空");return;
            }else{
                var indx = layer.msg('保存中....', {icon: 16,shade: 0.01});
                $.post('__MODULE__/Index/about_save',{content:content},function (data) {
                    console.log(data);
                    if(data.status==1){
                        layer.close(indx);
                        layer.msg(data.msg);
                        setTimeout(function () {location.reload();}, 1000);
                    }else{
                        layer.msg(data.msg);
                    }
                })
            }
        }
    </script>
</body>

</html>
